package testPackage.testPackage;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;

/**
 * step by step 10
 * 鼠标悬停
 * action.moveToElement(element).perform()
 */
public class Selenium11 {
    public static void main(String[] args) throws InterruptedException {
        String str = "D:\\\\Enviroments\\\\geckodriver-v0.26.0-win64\\\\chromedriver.exe";
        System.setProperty("webdriver.chrome.driver", str);
        WebDriver driver = new ChromeDriver();
        driver.get("https://tb.alicdn.com/snapshot/index.html");
        driver.manage().window().maximize();
        //鼠标悬停
        Actions action = new Actions(driver);
        WebElement element = driver.findElement(By.xpath("//*[@id=\"J_TSearchForm\"]/div[1]/button"));
        action.moveToElement(element).perform();
        Thread.sleep(3000);
        driver.quit();
    }
}
